/* 
 * File:   gui_util.h
 * Author: tasx
 *
 * Created on 26 settembre 2011, 15.37
 */

#ifndef GUI_UTIL_H
#define	GUI_UTIL_H

#ifdef	__cplusplus
extern "C" {
#endif

#include <glib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include "type.h"
#include "../gui/type_gui.h"

/* utile per un cast veloce ;) */
#define GRAPHIC_ELEMENT(a) ((graphic_element*) a)

    enum {
        /* posizione centrale orizzontale */
        GUI_POS_CENTER_H,
        /* posizione centrale verticale */
        GUI_POS_CENTER_V,
        GUI_POS_LEFT,
        GUI_POS_RIGHT,
        GUI_POS_TOP,
        GUI_POS_BOTTOM
    };

    void gui_util_check_init();

    void gui_util_set_element_pos(graphic_element*, int, int);

    void gui_util_set_element_pos_flag(main_obj*, graphic_element*, int);

    void gui_util_set_position_on_screen(main_obj*, graphic_element*, int);

    char* gui_util_convert_key_to_char(main_obj*, SDLKey);

    SDL_Surface *gui_util_drawtext(TTF_Font*, short, short, short, short, short, short, short, short, char*);

    SDL_Surface *gui_util_get_new_empty_surface(int, int);

    gboolean gui_util_element_is_clicked(main_obj*, graphic_element*);
    
    gint gui_util_get_center_x(main_obj*);
    
    gint gui_util_get_center_y(main_obj*);

#ifdef	__cplusplus
}
#endif

#endif	/* GUI_UTIL_H */

